package com.ies.dx.dex.file;

import com.ies.dx.util.Input;

public class string_data_item extends dex_item
{
    private int utf16_size;
    private byte[] data;
 
    public string_data_item(dex_file file) 
    {
        super(file);
    }
    
    public void read(Input dis)
    {
        try
        {
            utf16_size = dis.readULeb128();
            data = new byte[utf16_size];
            dis.read(data);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    
    public void show()
    {
        try
        {
            System.out.println("[data]: " + new String(data, "UTF-8"));
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    public String getData() 
    {        
        try
        {
            return new String(data, "UTF-8");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public void readData(Input dis)
    {
        // TODO Auto-generated method stub
        
    }
}
